package com.central.scheduler.plugin.task.shell;

import com.central.common.model.ResourceInfo;
import com.central.scheduler.spi.task.AbstractParameters;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @author Tindy
 * @date 2021/11/15
 * @describe
 */
@Getter
@Setter
public class ShellParameters extends AbstractParameters {

    /**
     * shell script
     */
    private String rawScript;

    /**
     * resource list
     */
    private List<ResourceInfo> resourceList;

    public String getRawScript() {
        return rawScript;
    }

    public void setRawScript(String rawScript) {
        this.rawScript = rawScript;
    }

    public List<ResourceInfo> getResourceList() {
        return resourceList;
    }

    public void setResourceList(List<ResourceInfo> resourceList) {
        this.resourceList = resourceList;
    }

    @Override
    public boolean checkParameters() {
        return rawScript != null && !rawScript.isEmpty();
    }

    @Override
    public List<ResourceInfo> getResourceFilesList() {
        return resourceList;
    }
}

